#include <iostream>
#include <memory>

// 抽象租方类
class RentHouse{
public:
    virtual void rentHouse() = 0;
};

// 房东类
class Landlord : public RentHouse{
public:
    void rentHouse(){
        std::cout << "将房子租出去" << std::endl;
    }
};

// 中介代理者类
class Intermediary : public RentHouse{
public:
    void rentHouse(){
        std::cout << "发布租房广告" << std::endl;
        std::cout << "带顾客看房子" << std::endl;
        _landlord.rentHouse();
        std::cout << "售后维修" << std::endl;
    }

private:
    Landlord _landlord;
};

int main(){
    Intermediary iter;
    iter.rentHouse();
    return 0;
}
